﻿@model LeEdu.MODEL.Courses

@{
    Layout = null;
}

<!DOCTYPE html>

<html>

<!-- 网页头部分布视图 -->
@Html.Partial("~/Views/Shared/HouTai_Header.cshtml")


<body>
    <!--视频上传js引用-->
    <link rel="stylesheet" href="~/uploadflie/css/plupload.queue.css" type="text/css" media="screen" />
    <script type="text/javascript" src="~/uploadflie/jquery.min.js"></script>
    <script type="text/javascript" src="~/uploadflie/jquery.plupload.queue.min.js"></script>
    <script type="text/javascript" src="~/uploadflie/plupload.min.js"></script>
    <script type="text/javascript" src="~/uploadflie/plupload.flash.min.js"></script>


    <link rel="stylesheet" href="~/upload/css/plupload.queue.css" type="text/css" media="screen" />
    <script type="text/javascript" src="~/upload/jquery.min.js"></script>
    <script type="text/javascript" src="~/upload/jquery.plupload.queue.min.js"></script>
    <script type="text/javascript" src="~/upload/plupload.min.js"></script>
    <script type="text/javascript" src="~/upload/plupload.flash.min.js"></script>

    <!--[if lt IE 9]>
      <script src="js/html5shiv.js?6.9.3"></script>
      <script src="js/respond.min.js?6.9.3"></script>
    <![endif]-->
    <link href="~/Content/css/common.css" rel="stylesheet" />
    <link href="~/Content/css/font-awesome.min.css" rel="stylesheet" />
    <link href="~/Content/css/es-icon.css" rel="stylesheet" />

    <script>



    $(function () {
        // 初始化Flash上传插件
        $("#flash_uploader").pluploadQueue({
            runtimes: 'html5,flash,silverlight,html4', 	//使用Flash插件
            url: '@Url.Content("/Course/UploadFile")', 	//服务器端响应页面
            max_file_size: '2048mb', //最大文件限制
            chunk_size: '10mb', 	//一次上传数据大小
            unique_names: true, 	//是否自动生成唯一名称
            filters: [				//文件类型限制，需要对上传文件进行限制可以使用
                { title: "视频文件", extensions: "mp4,webm,ogg,docx,txt,mp3,pptx" }
            ],

            // 缩放图片
            //resize: { width: 180, height: 150, quality: 80 },

            // SWF文件位置
            flash_swf_url: '@Url.Content("~/upload/plupload.flash.swf")',

            init: {
                FileUploaded: function (up, file, info) {
                    //一个文件上传成功
                    alert("上传成功！");
                },

                Error: function (up, args) {
                    //发生错误
                    if (args.file) {
                        alert('[error] File:' + args.file);
                    } else {
                        alert('[error]' + args);
                    }
                }
            }
        });
        //选择操作
        $("#qx1").click(function () {

            if (this.checked == true) {
                $("input[name='xz']").attr("checked", true)
            }
            else {
                $("input[name='xz']").attr("checked", false)
            }
        }
         );

    });
    $(function () {
        $("#myModal").on("hide.bs.modal", function () {
            //$(this).removeData("bs.modal");
            $("#StuCount").val = '';
            $("#flash_uploader").val = "";
        });


    })
    //删除操作
    function DelFile() {
        var NumObj = $('input[name="xz"]:checked');
        if (NumObj.length <= 0) {
            alert("请选择删除项目");
        }
        else {
            var ids = "";
            for (var i = 0; i < NumObj.length; i++) {
                ids += NumObj[i].value + ",";
            }
            $.post("/Course/DelFile", { jihe: ids }, function (data) {
                if (data == "1") {
                    alert("删除成功");
                    location.href = '/Course/FileManage';
                }

            })

        }
    }
    </script>

    <!-- 网页导航菜单分布视图 -->
    @Html.Partial("~/Views/Shared/HouTai_DaoHang.cshtml")

    <div class="container">
        <div class="row">
            <!-- 网页左侧菜单分布视图 -->
            @Html.Partial("~/Views/Shared/CouseCreateManage_Menu_Left.cshtml")


            <div class="col-md-10">
                <style type="text/css">
                    .tooltip-inner {
                        max-width: 600px;
                    }
                </style>
                <div class="panel panel-default panel-col">
                    <div class="panel-heading">

                        <!-- Button trigger modal -->
                        <button type="button" class="btn btn-info btn-sm pull-right" data-toggle="modal" data-target="#myModal">
                            文件管理
                        </button>


                    </div>
                    <div class="panel-body" id="file-manage-panel">
                        <ul class="nav nav-tabs mbm">
                            <li class="active">
                                <a href="/course/116/manage/files?type=courselesson">课时文件</a>
                            </li>
                            <li><a href="/course/116/manage/files?type=coursematerial">备用资料文件</a></li>
                        </ul>
                        <table class="table table-striped table-hover" id="course-lesson-table">
                            <thead>
                                <tr>
                                    <th></th>
                                    <th>文件名</th>
                                    <th>类型</th>
                                    <th>大小</th>
                                    <th>最后更新</th>
                                </tr>
                            </thead>
                            @foreach (var item in ViewBag.list as List<LeEdu.MODEL.Files>)
                            {
                                <tbody>
                                    <tr>
                                        <td>
                                            <input data-role="batch-select" type="checkbox" name="xz" value="@item.FilesId">
                                        </td>
                                        <td>
                                            @item.FilesName
                                        </td>
                                        <td>
                                            @(item.FType == 0 ? "视频" : item.FType == 1 ? "音频" : item.FType == 2 ? "word文档" : item.FType==3?"txt文档":"ppt文档")
                                        </td>
                                        <td>
                                            @item.FSize MB
                                        </td>
                                        <td>
                                            @item.FTime
                                        </td>
                                    </tr>
                                </tbody>
                            }
                        </table>

                        <label class="checkbox-inline mrm mbm"><input data-role="batch-select" type="checkbox" id="qx1" name="qx"> 全选</label>

                        <div class="btn-group mbm">
                            <button class="btn btn-danger btn-sm" data-role="batch-delete" onclick="DelFile()" data-name="文件记录" data-url="/course/116/delete/files/courseLesson">
                                <i class="glyphicon glyphicon-trash"></i>
                                删除
                            </button>

                        </div>

                        <nav class="text-center">

                        </nav>

                    </div>
                </div>
            </div>
        </div>



    </div>
    <!--模态框-->
    <!-- Modal -->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <form method="post" action="/Course/AddFiles">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                        <h4 class="modal-title">
                            上传课时文件
                        </h4>
                        <br />
                        <input id="Radio1" type="radio" name="FType" value="0"/>&nbsp;&nbsp;视频&nbsp;&nbsp;&nbsp;&nbsp;
                        <input id="Radio1" type="radio" name="FType" value="1" />&nbsp;&nbsp;音频&nbsp;&nbsp;&nbsp;&nbsp;
                        <input id="Radio1" type="radio" name="FType" value="2" />&nbsp;&nbsp;word文档&nbsp;&nbsp;&nbsp;&nbsp;
                        <input id="Radio1" type="radio" name="FType" value="3" />&nbsp;&nbsp;txt文档&nbsp;&nbsp;&nbsp;&nbsp;
                        <input id="Radio1" type="radio" name="FType" value="4" />&nbsp;&nbsp;ppt文档
                    </div>
                    <div class="modal-body">
                        <style>
                            .plupload_filelist_footer {
                                height: 40px;
                                line-height: 20px;
                            }
                        </style>
                        @*<div id="file-uploader-container" class="mbl" data-target-type="courselesson" data-upload-mode="local" data-hls-encrypted="1">

                                <div style="position: relative;" id="file-chooser-uploader-div" data-role="uploader-div" data-upload-url="/uploadfile/upload?targetType=courselesson&amp;targetId=101" data-params-url="/uploadfile/params?storage=local&amp;targetType=courselesson&amp;targetId=101"><div class="plupload_wrapper plupload_scroll"><div id="file-chooser-uploader-div_container" class="plupload_container"><div class="plupload"><div class="plupload_header"><div class="plupload_header_content"><div class="plupload_header_title">选择文件</div><div class="plupload_header_text">将文件添加到上传队列，然后点击”开始上传“按钮。</div></div></div><div class="plupload_content"><div class="plupload_filelist_header"><div class="plupload_file_name">文件名</div><div class="plupload_file_action">&nbsp;</div><div class="plupload_file_status"><span>状态</span></div><div class="plupload_file_size">大小</div><div class="plupload_clearer">&nbsp;</div></div><ul style="position: relative;" id="file-chooser-uploader-div_filelist" class="plupload_filelist"><li class="plupload_droptext">把文件拖到这里。</li></ul><div class="plupload_filelist_footer"><div class="plupload_file_name"><div class="plupload_buttons"><a style="position: relative; z-index: 1;" href="#" class="plupload_button plupload_add" id="file-chooser-uploader-div_browse">增加文件</a><a href="#" class="plupload_button plupload_start plupload_disabled">开始上传</a></div><span class="plupload_upload_status"></span></div><div class="plupload_file_action"></div><div class="plupload_file_status"><span class="plupload_total_status">0%</span></div><div class="plupload_file_size"><span class="plupload_total_file_size">0 b</span></div><div class="plupload_progress"><div class="plupload_progress_container"><div class="plupload_progress_bar"></div></div></div><div class="plupload_clearer">&nbsp;</div></div></div></div></div><input id="file-chooser-uploader-div_count" name="file-chooser-uploader-div_count" value="0" type="hidden"></div><div style="position: absolute; top: 292px; left: 16px; width: 78px; height: 24px; overflow: hidden; z-index: 0;" class="moxie-shim moxie-shim-html5" id="html5_1a5u9grgu1csm10rd1iti57l1tqq6_container"><input id="html5_1a5u9grgu1csm10rd1iti57l1tqq6" style="font-size: 999px; opacity: 0; position: absolute; top: 0px; left: 0px; width: 100%; height: 100%;" multiple="" accept="audio/mpeg,video/mp4" type="file"></div></div>

                            </div>*@
                        <div class="file-chooser-uploader-control">
                            <div id="flash_uploader" style="width:80%; height: 450px;">您没有安装Flash！</div>
                        </div>
                        <div class="alert alert-info">
                            <ul>
                                <li>支持<strong>mp4, mp3</strong>格式的文件上传，且文件大小不能超过<strong>1.0GB</strong>。<br>MP4文件的视频编码格式，请使用AVC(H264)编码，否则浏览器无法播放。</li>
                                <li>视频将上传到<strong>网站服务器</strong>，如需使用EduSoho云视频,点击<a href="http://open.edusoho.com/show/cloud/video" target="_blank">这里</a>了解详情。</li>
                            </ul>
                        </div>

                        <script>app.load('course-manage-file/upload-course-files')</script>
                    </div>
                    <div class="modal-footer">
                        @*<button type="submit" class="btn btn-primary" data-dismiss="modal">关闭</button>*@
                        @*<input class="btn btn-primary" data-dismiss="modal" id="Submit1" type="submit" value="保存" />*@
                        <button id="course-lesson-btn" data-submiting-text="正在提交" type="submit" class="btn btn-primary" data-toggle="form-submit" data-target="#course-lesson-form">保存</button>

                    </div>
                </form>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>



    @*模态框传值问题（加载一次模态框 清楚一下以前的数据  不然数据不变）*@
    <script>
        $("#myModal").on("hidden.bs.modal", function () {
            $(this).removeData("bs.modal");
        })
    </script>
    <script>
        var app = {};
        app.debug = false;
        app.version = '6.9.3';
        app.httpHost = 'http://www.zhishile.com';
        app.basePath = '';
        app.theme = 'jianmo';
        app.themeGlobalScript = 'theme/global-script';
        app.jsPaths = { "common": "common", "theme": "\/themes\/jianmo\/js", "customwebbundle": "\/bundles\/customweb\/js", "customadminbundle": "\/bundles\/customadmin\/js", "topxiawebbundle": "\/bundles\/topxiaweb\/js", "topxiaadminbundle": "\/bundles\/topxiaadmin\/js", "classroombundle": "\/bundles\/classroom\/js" };
        app.crontab = '/common/crontab';

        var CKEDITOR_BASEPATH = app.basePath + '/assets/libs/ckeditor/4.6.7/';
        app.config = { "api": { "weibo": { "key": "" }, "qq": { "key": "" }, "douban": { "key": "" }, "renren": { "key": "" } }, "cloud": { "video_player": "http:\/\/cdn.staticfile.org\/GrindPlayerCN\/1.0.2\/GrindPlayer.swf", "video_player_watermark_plugin": "http:\/\/cdn.staticfile.org\/GrindPlayerCN\/1.0.2\/Watermake-1.0.3.swf", "video_player_fingerprint_plugin": "http:\/\/cdn.staticfile.org\/GrindPlayerCN\/1.0.2\/Fingerprint-1.0.1.swf" }, "loading_img_path": "\/assets\/img\/default\/loading.gif?6.9.3" };
        app.arguments = {};
        app.controller = 'user/list';

        app.scripts = null;

        app.uploadUrl = '/file/upload';
        app.imgCropUrl = '/file/img/crop';
        app.lessonCopyEnabled = '0';
        app.mainScript = '/bundles/topxiaadmin/js/admin-app.js?6.9.3';
    </script>
    <script src="/Content/js/sea.js?6.9.3"></script>
    <script src="/Content/js/seajs-style.js?6.9.3"></script>
    <script src="/Content/js/seajs-global-config.js?6.9.3"></script>
    <script>
        seajs.use(app.mainScript);
    </script>  <div id="modal" class="modal"></div>
    <div class="fixed-bar">
        <a href="/admin/feedback" target='_blank' class="icon-question-text feedback">
            <i class="es-icon es-icon-help"></i>
            <span>产品<br />反馈</span>
        </a>
    </div>
</body>



</html>
